function handleImport() {
  addDialog({
    fullscreenIcon: true,
    width: "500px",
    title: `导入${titleMenu}`,
    contentRenderer: () => h(Import, { ref: formRef }),
    props: {
      formInline: {
        file: null
      }
    },
    beforeSure: async (done, { options }) => {
      const FormRef = formRef.value.getRef();
      const curData = options.props.formInline as FormItemProps;

      FormRef.validate(async valid => {
        if (valid) {
          try {
            const formData = new FormData();
            formData.append("file", curData.file);

            const res = await importData(formData);
            if (res.success) {
              // 导入任务已提交，显示提示
              message("文件已上传，正在后台导入...", { type: "success" });
              done(); // 关闭弹框

              // 打开导入记录页面
              handleImportRecord();
            } else {
              message(res.message, { type: "error" });
            }
          } catch (error) {
            message("导入失败", { type: "error" });
          }
        }
      });
    }
  });
} 